<?php

namespace App\Console\Commands\Movie;

use Illuminate\Console\Command;
use App\Bots\Watcher;
class Watch extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'movie:watch';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '打卡机器人';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $watch = new Watcher;
        $i = 0;
        do {
            $isRun = config('bot.watch');
            $watch->watching();
            $watch->watched();
            $i++;
        } while ($isRun && $i < config('bot.count'));
    }
}
